The get method returns a floating value for a given index.
var get(index);
index
Numeric index for which to retrieve the value.
Returns a floating value if index is valid, otherwise, returns null.
The following example demonstrates the use of get() method.
function calculate(beginIndex, endIndex)
{
var studyData = this.getStudyData("customSMA");
if(studyData != null)
{
//get the last value and write it to the Debug Console
if(studyData.count() > 0)
{
var value = studyData.get(studyData.count() - 1);
if(value != null)
{
Debug.writeLine("last value is :" + value);
}
}
}
}
Copyright © 2006-2009 ActiveTick LLC